﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GLSimulationControl;
using MySafeLib;

namespace _3CMillingSimulator
{
    public partial class CreateMaterialForm : Form
    {
        public UInt32 Material_Width
        {
            get
            {
                UInt32 result = 0 ;
                SafeStringParser<UInt32> parser = new SafeStringParser<uint>();
                parser.Parse( this.WidthTextBox.Text, ref result );
                return result;
            }
        }

        public UInt32 Material_Height
        {
            get
            {
                UInt32 result = 0;
                SafeStringParser<UInt32> parser = new SafeStringParser<uint>();
                parser.Parse( this.HeightTextBox.Text, ref result );
                return result;
            }
        }

        public UInt32 Material_InitialDepth
        {
            get
            {
                UInt32 result = 0;
                SafeStringParser<UInt32> parser = new SafeStringParser<uint>();
                parser.Parse( this.InitialDepthTextBox.Text, ref result );
                return result;
            }
        }

        public CreateMaterialForm()
        {
            InitializeComponent();
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            SimulatorControlGL.CreateSimulation( this.Material_Width, this.Material_Height, this.Material_InitialDepth );
            this.Close();
        }

        private void cancelButton_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
